package com.wang.hw.hw1;

public class Test {
    public static void main(String[] args) {
        System.out.println("圆形底面的柱体体积的计算：");
        Circle c = new Circle(2);
        double base = c.getArea();
        Pillar p = new Pillar(base,4);
        System.out.println("圆形底面的柱体体积为：" + p.getVolume());
        System.out.println("----------------------");
        System.out.println("矩形底面的柱体体积的计算：");
        Rectangle r = new Rectangle(4,6);
        double base1 = r.getArea();
        Pillar p1 = new Pillar(base1,4);
        System.out.println("矩形底面的柱体体积为：" + p1.getVolume());
    }
}
